package com.sjtu.vfact.textual.util;


public enum TABLE_TYPE {
	
	MASTER_TERMSET("Master Termset", new String[]{"No", "Master Termset", "Documents Pair"}),
	
	SUMMARIZER("Summarizer", new String[]{"No", "Summarizer's Summmary", "DocIDs", "Support"}),
	
	ENUMERATOR("Enumerator", new String[]{"No", "Enumerator's Summary", "DocIDs", "Support"}),
	
	UNCOVERED_TERMS("Uncovered Terms", new String[]{"No", "Uncovered Terms", "DocIDs", "Support"});
	
	private String tableName;
	private String[] columnNames;
	
	private TABLE_TYPE(String tableName, String[] columnNames){
		this.tableName = tableName;
		this.columnNames = columnNames;
	}
	
	public static TABLE_TYPE getTableTypeByTableName(String tableName) {
		TABLE_TYPE type = null;
		if (tableName == null) {
			System.out.println("Error: getTableTypeByTableName(null)");
		} else if (tableName.equals("Master Termset")) {
			type = MASTER_TERMSET;
		} else if (tableName.equals("Summarizer")) {
			type = SUMMARIZER;
		} else if (tableName.equals("Enumerator")) {
			type = ENUMERATOR;
		} else if (tableName.equals("Uncovered Terms")) {
			type = UNCOVERED_TERMS;
		} 

		return type;
	}
	
	public String getTableName(){
		return this.tableName;
	}
	
	public String[] getColumnNames(){
		return this.columnNames;
	}
	
	public int getColumnsCount(){
		return columnNames.length;
	}

}

